//
//  LMSettingCell.m
//  MeetCard
//
//  Created by longmin on 16/12/15.
//  Copyright © 2016年 timtian. All rights reserved.
//

#import "LMSettingCell.h"

@interface LMSettingCell ()

@property(nonatomic, strong) UIView *line;

@end

@implementation LMSettingCell


#pragma mark - 生命周期

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.line];
        self.showLine = YES;
    }
    return self;
}

#pragma mark - Event
#pragma mark - Public

+ (instancetype)settingCell{
    
    LMSettingCell *cell = [[LMSettingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.font = _kFont32;
    cell.textLabel.textColor = kColor3C3C3C;
    
    return cell;
}

-(void)setShowLine:(BOOL)showLine {
    _showLine = showLine;
    
    self.line.hidden = !showLine;
}

#pragma mark - Private
#pragma mark - 数据源和代理方法
#pragma mark - UIView -> 下面放继承自UIView的方法

-(void)layoutSubviews {
    [super layoutSubviews];
    
    self.line.height = 0.5;
    self.line.width = self.width - MK_PADDING_30;
    self.line.left = MK_PADDING_30;
    self.line.bottom = self.height;
}

#pragma mark - set方法和get方法

-(UIView *)line {
    if (_line == nil) {
        _line = [[UIView alloc] init];
        _line.backgroundColor = kColorD9D9D9;
    }
    return _line;
}

@end
